package com.yc.project.servlet;

import com.yc.project.dao.DishDao;
import com.yc.project.util.Utils;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.Map;

@WebServlet(name = "GetDishServlet", value = "/getDish.s")
public class GetDishServlet extends HttpServlet {
/**根据id查询该id所属信息
 * */
    private DishDao dishDao = new DishDao();
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String id = request.getParameter("id");
        Map<String, Object> movie = dishDao.selectById(id);
        Utils.toJson(movie, response);
    }


}
